<?php

/**
 * page to search for symbols out of va_stratlab database
 *
 * @author voellenk
 */

set_include_path(get_include_path(). PATH_SEPARATOR. 'inc/');
require_once 'inc/globals.secret.php';
function __autoload($class_name) {
  require_once $class_name.'.class.php';
}

session_start();

$page = new symsearchpage("va_stratlab symbol search page");
echo $page->htmlhead("va_stratlab.css");
echo $page->htmlbodytag();

// connect to va_stratlab database
$mysql = new db($dbparams["host"].":".$dbparams["port"], $dbparams["user"], $dbparams["password"]);
$mysql->connect($dbparams["db"]);

if (empty ($_GET)) {
  $page->presetFormVariables();
} else {
  $page->parseGetVariable($_GET);
}

$page->getGeneralDbInfos($mysql);

echo $page->titleBar();

if ($page->showsymdetails) {
  echo $page->symdetails();
} elseif ($page->showdboverview) {
  echo $page->dboverview();
} elseif ($page->showexchangeoverview) {
  echo $page->exchangeoverview();  
} else {
  echo $page->error;
}

echo $page->htmlend();
$mysql->disconnect();
?>
